﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WcfContrib.Extensions.Caching
{
    /// <summary>
    /// Represents a cache provider factory which creates "IntervalBasedCacheProvider" with a Synchronized Dictionary as its IOutputCacheStore (in-proc cache)
    /// </summary>
    public class IntervalBasedCacheProviderFactory : IOutputCacheProviderFactory
    {
        const int DefaultCollectIntervalInMs = 1000 * 60 * 15;

        #region IOutputCacheProviderFactory Members

        /// <summary>
        /// Creates the output cache provider.
        /// </summary>
        /// <returns>The output cache provider</returns>
        public IOutputCacheProvider CreateProvider()
        {
            return new IntervalBasedCacheProvider(DefaultCollectIntervalInMs, new InProcOutputCacheStore());
        }

        #endregion
    }
}
